package com.heima.admin.controller.v1;

import com.heima.admin.service.LoginService;
import com.heima.model.admin.dto.AdUserDTO;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
@Api(value = "admin登录",tags = "admin登录controller")
public class LoginController {
    @Autowired
    private LoginService loginService;

    @ApiOperation(value = "根据用户名密码登录",notes = "根据参数name password")
    @PostMapping("/in")
    public ResponseResult loginIn(@RequestBody AdUserDTO adUserDTO){
        return loginService.loginIn(adUserDTO);

    }
}
